- @title = t('checkin.times.heading')

%h3
  = t('checkin.times.recurring.heading')
  = link_to '#', class: 'btn btn-success btn-xs', data: { toggle: '#new_recurring_time' } do
    = icon 'fa fa-plus'
    = t('checkin.times.recurring.new.button')

= form_for :checkin_time, url: administration_checkin_times_path, html: { class: 'form-inline', style: 'display:none;', id: 'new_recurring_time' }, method: 'post' do |form|
  .form-group
    = form.select :weekday, Date::DAYNAMES.each_with_index.to_a, {}, class: 'form-control'
    = form.text_field :time, size: 8, class: 'form-control', placeholder: t('checkin.times.recurring.time')
    = react_component 'ReactComponents.SelectWithNew', name: 'checkin_time[campus]', value: '', options: checkin_time_campuses, className: 'form-control', includeBlank: true
    = form.button t('checkin.times.recurring.add.button'), class: 'btn btn-success'

- if @recurring_times.any?
  = render partial: 'times', object: @recurring_times
- else
  %p= t('none')

%h3
  = t('checkin.times.single.heading')
  = link_to '#', class: 'btn btn-success btn-xs', data: { toggle: '#new_single_time' } do
    = icon 'fa fa-plus'
    = t('checkin.times.single.new.button')

= form_for :checkin_time, url: administration_checkin_times_path, html: { class: 'form-inline', style: 'display:none;', id: 'new_single_time' }, method: 'post' do |form|
  %p
    = form.text_field :the_datetime, size: 15, class: 'form-control', placeholder: t('checkin.times.single.datetime')
    = react_component 'ReactComponents.SelectWithNew', name: 'checkin_time[campus]', value: '', options: checkin_time_campuses, className: 'form-control', includeBlank: true
    = form.button t('checkin.times.single.add.button'), class: 'btn btn-success'

- if @single_times.any?
  = render partial: 'times', object: @single_times
- else
  %p= t('none')
